package com.biaobiaoqi.scoreanalysis.administrator.action;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.service.IClazzService;
import com.opensymphony.xwork2.ActionSupport;

public class DeleteClazz extends ActionSupport {
 	private static final long serialVersionUID = 1L;
 	private static final Log log = LogFactory.getLog(DeleteClazz.class);
 	
 	private int id;
 	
 	@Resource
 	private IClazzService clazzService;
 	
 	public String execute() {
		log.debug("delete clazz:"+id);
		try {
			clazzService.deleteClazz(id);
			return SUCCESS;
		} catch (Exception e) {
			log.error("delete clazz failed", e);
			return ERROR;
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public IClazzService getClazzService() {
		return clazzService;
	}

	public void setClazzService(IClazzService clazzService) {
		this.clazzService = clazzService;
	}
}
